<script language="JavaScript">
    Ajax_frota = new AbrirAjax();
    Ajax_visitante = new AbrirAjax();
    Ajax_prestador = new AbrirAjax();
    atualiza_frota();
    atualiza_visitante();
    atualiza_prestador();
    window.setInterval('atualiza_frota()', 10000);
    window.setInterval('atualiza_visitante()', 10000);
    window.setInterval('atualiza_prestador()', 10000);
    
    function atualiza_frota()
    {
        Ajax_frota.open('post','processa_monitor.php',true);
        Ajax_frota.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
        Ajax_frota.setRequestHeader("encoding", "ISO-8859-1");
        Ajax_frota.onreadystatechange = envia_frota;
        Ajax_frota.send('chamada=frota');
    }
                
    function envia_frota()
    {
        if(Ajax_frota.readyState == 4)
        {
            str = new String;
            str = Ajax_frota.responseText;

            document.getElementById("grade_frota").innerHTML = str;
        }
    }

    function atualiza_visitante()
    {

        Ajax_visitante.open('post','processa_monitor.php',true);
        Ajax_visitante.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
        Ajax_visitante.setRequestHeader("encoding", "ISO-8859-1");
        Ajax_visitante.onreadystatechange = envia_visitante;
        Ajax_visitante.send('chamada=visitante');
    }

    function envia_visitante()
    {
        if(Ajax_visitante.readyState == 4)
        {
            str = new String;
            str = Ajax_visitante.responseText;

            document.getElementById("grade_visitante").innerHTML = str;
        }
    }

    function atualiza_prestador()
    {

        Ajax_prestador.open('post','processa_monitor.php',true);
        Ajax_prestador.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
        Ajax_prestador.setRequestHeader("encoding", "ISO-8859-1");
        Ajax_prestador.onreadystatechange = envia_prestador;
        Ajax_prestador.send('chamada=prestador');
    }

    function envia_prestador()
    {
        if(Ajax_prestador.readyState == 4)
        {
            str = new String;
            str = Ajax_prestador.responseText;

            document.getElementById("grade_prestador").innerHTML = str;
        }
    }
        
</script>

<div>

    <center><img src="monitor.png"/></center>
    <fieldset style="float:left; width: 280px; height: 400px">
        <legend style="font-size: 20px; background: #D3D3D3; color: #696969">Frota</legend>
        <div style="width: 280px; height: 20px; margin-top: 25px">
            <div id="placa" style="width: 100px; float:left; text-align: center; margin-left: 33px">Placa</div>
            <div id="dt_ent" style="width: 70px; float:left; text-align: center">Data</div>
            <div id="hr_ent" style="width: 50px; float:left; text-align: center">Hora</div>
        </div>
        <div id="grade_frota" style="width: 280px; height:320px; float:left; text-align: left; overflow: scroll; overflow-x: hidden"></div>
    </fieldset>

    <fieldset style="float:left; width: 550px; height: 400px">
        <legend style="font-size: 20px; background: #D3D3D3; color: #696969">Visitante</legend>
        <div style="width: 550px; height: 20px; margin-top: 25px">
            <div id="placa" style="width: 80px; float:left; text-align: center; margin-left: 80px">Nome</div>
            <div id="placa" style="width: 80px; float:left; text-align: center; margin-left: 90px">Empresa</div>
            <div id="dt_ent" style="width: 60px; float:left; text-align: center;margin-left: 62px">Data</div>
            <div id="hr_ent" style="width: 60px; float:left; text-align: center; margin-left: 12px">Hora</div>
        </div>
        <div id="grade_visitante" style="width: 550px; height:315px; float:left; text-align: left; overflow: scroll; overflow-x: hidden"></div>
    </fieldset>

    <fieldset style="float:left; width: 280px; height: 400px">
        <legend style="font-size: 20px; background: #D3D3D3; color: #696969">Prestador</legend>
        <div style="width: 280px; height: 20px; margin-top: 25px">
            <div id="placa" style="width: 100px; float:left; text-align: center; margin-left: 33px">Placa</div>
            <div id="dt_ent" style="width: 70px; float:left; text-align: center">Data</div>
            <div id="hr_ent" style="width: 50px; float:left; text-align: center">Hora</div>
        </div>
        <div id="grade_prestador" style="width: 280px; height:320px; float:left; text-align: left; overflow: scroll; overflow-x: hidden"></div>
    </fieldset>
</div>
